package com.neutech.maplestory.entity;

/**
 * 道具包
 */

import com.neutech.maplestory.client.MapleStoryClient;
import com.neutech.maplestory.util.ImageUtil;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class ItemPackage extends AbstractMapleStoryObject{

    public List<Item> items = new CopyOnWriteArrayList<>();

    public Image img;
    public ItemPackage(){
        this.x = 1600;
        this.y = 130;
    }
    public ItemPackage(MapleStoryClient msc){
        this();
        this.msc = msc;
        this.img = ImageUtil.getImage("itemPackage");
        /*this.live = false;// 默认false 可写可不写*/
    }
    @Override
    public void draw(Graphics g) {
        if (live){
            g.drawImage(img,x,y,null);
            for (int i = 0; i < items.size(); i++) {
                Item item = items.get(i);
                g.drawImage(item.img,x + 15 + (i * 35),y + 50,null);
                g.drawString(item.qty + "",x + 15 + (i * 35),y + 35 + 50);
            }
        }
    }

    /**
     * 鼠标单击的方法
     * @param e 单击事件对象
     */
    /*public void mousePressed(MouseEvent e){

    }*/

    /**
     * 鼠标释放的方法
     * @param e 释放事件对象
     */
    /*public void mousePressed(MouseEvent e){

    }*/
}
